<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:ic="http://ivyteam.ch/jsf/component"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>JSF User Dialog</title>
	<style>
.ui-panelgrid {
	border: 0px solid red;
}
</style>
</h:head>
<h:body>
	<ui:composition
		template="../template/masterTemplate/masterTemplate.xhtml">
		<ui:define name="title">
        User information
    </ui:define>
		<ui:define name="header">
			<div style="display: inline-block;">
				Task of
				<h:outputLabel value="#{data.currentUser.firstName}" />
				<h:outputLabel value=" "></h:outputLabel>
				<h:outputLabel value="#{data.currentUser.lastName}"></h:outputLabel>
				<h:outputLabel value=" "></h:outputLabel>
			</div>
		</ui:define>
		<ui:define name="center">
			<h:form id="formInfo">
				<p:panelGrid columns="4" style="border:0px solid red;">
					<h:outputText value="Process:  "></h:outputText>
					<p:selectOneMenu value="#{data.selectedFilter}" var="p">
						<f:selectItem itemLabel="All" itemValue="0" />
						<f:selectItems value="#{data.filerName}" var="name"
							itemLabel="#{name}" itemValue="#{name}" />
						<f:ajax listener="#{logic.changeList}" update="taskTable"></f:ajax>
					</p:selectOneMenu>
					<!-- <p:commandButton value="Filter"
						actionListener="#{logic.changeList}" update="taskTable"></p:commandButton> -->
				</p:panelGrid>
				<p:dataTable id="taskTable" value="#{data.userTasks}" var="item"
					frame="border" styleClass="order-table"
					headerClass="order-table-header"
					rowClasses="order-table-odd-row,order-table-even-row" border="1"
					paginator="true"
					paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rows="5" rowsPerPageTemplate="5,10,15" paginatorPosition="bottom">
					<p:column sortBy="#{item.id}">
						<f:facet name="header">Task ID</f:facet>
						#{item.id}
					</p:column>
					<p:column sortBy="#{item.employeeNum}">
						<f:facet name="header">Employee Number
					</f:facet>
					#{item.employeeNum}
					</p:column>
					<p:column sortBy="#{item.type}">
						<f:facet name="header">Process Type
					</f:facet>
					#{item.type}
					</p:column>
					<p:column sortBy="#{item.taskName}">
						<f:facet name="header">Task Name
					</f:facet>
					#{item.taskName}
					</p:column>
					<p:column sortBy="#{item.department}">
						<f:facet name="header">Department
					</f:facet>
					#{item.department}
					</p:column>
					<p:column sortBy="#{item.status}">
						<f:facet name="header">Status</f:facet>#{item.status}
					</p:column>
				</p:dataTable>
				<br />
				<p:commandButton id="btnCancel" styleClass="button"
					value="#{ivy.cms.co('/ch/ivy/demo/label/cancel')}"
					actionListener="#{logic.cancel}" process="@none"></p:commandButton>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>